<template>
  loginView
  <div class="login_div">
    <el-input placeholder="username" v-model="login_info.username"></el-input>
    <el-input placeholder="password" v-model="login_info.password"></el-input>
    <el-button type="primary" @click="do_login">登录</el-button>
  </div>
</template>

<script setup>
import {httpPost} from "../assets/js/HttpUtils";
import {useRouter} from "vue-router";

const router = useRouter();


let login_info = {
  username: "",
  password: ""
}

const do_login = () => {

  let formData = new FormData();

  formData.append("username", login_info.username);
  formData.append("password", login_info.password);

  httpPost("", formData).then((resp) => {

  }).catch((err)=>{
    console.log(err)
  }).finally((err) => {
    console.log(err)
  });

  router.push("/home");
};


</script>

<style lang="less" scoped>
.login_div {
  color: #999;
  width: 500px;
  height: 300px;
  border: 1px solid #eee;
  border-radius: 15px;

  box-sizing: border-box;
  padding: 20px;

  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
</style>
